package com.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.PayMapper;
import com.pojo.Pay;
import com.service.PayService;
import com.vo.LineVo;
import com.vo.PayVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("payService")
public class PayServiceImpl implements PayService {
    @Resource
    private PayMapper payMapper;
    @Override
    public List<Pay> selectPayByOwnerid(Integer ownerid) {
        List<Pay> pays = payMapper.selectPayByOwnerid(ownerid);
        return pays;
    }

    @Override
    public PageInfo<Pay> selectAllPay(PayVo payVo) {
        PageHelper.startPage(payVo.getPage(),payVo.getLimit());
        List<Pay> payList = payMapper.selectAllPay(payVo);
        PageInfo<Pay> payPageInfo=new PageInfo<>(payList);
        return payPageInfo;
    }

    @Override
    public int addPay(PayVo payVo) {
        int i = payMapper.addPay(payVo);
        return i;
    }

    @Override
    public int updatePay(PayVo payVo) {
        int i = payMapper.updatePay(payVo);
        return i;
    }

    @Override
    public PageInfo<Pay> OwnerSelectPayRecording(PayVo payVo) {
        PageHelper.startPage(payVo.getPage(),payVo.getLimit());
        List<Pay> payList = payMapper.ownerSelectRecording(payVo);
        PageInfo<Pay> payPageInfo=new PageInfo<>(payList);
        return payPageInfo;
    }

    @Override
    public List<LineVo> selectallpay() {
        List<LineVo> selectallpay = payMapper.selectallpay();
        return selectallpay;
    }

}
